import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
const routes: RouteRecordRaw[] = [
  
  {
    path: '/',
    name:'login',
    // component: Home, // 注意这里要带上 文件后缀.vue
    component: () => import('@/views/login/Login.vue'), // 注意这里要带上 文件后缀.vue
  },
  { 
    path: '/login',
    redirect: '/' 
  },
  {
    path: '/index',
    component: () => import('@/views/layout/layout.vue'), 
    children:[
      {
        path: 'my-page',
        component: () => import('@/views/page/myPage.vue'),
      } ,
      {
        path: 'monaco-editor',
        component: () => import('@/views/monaco/editor.vue'),
      } ,
      {
        path: 'script',
        component: () => import('@/views/script/index.vue'),
      } ,
      {
        path: 'upload',
        component: () => import('@/views/upload/upload.vue'),
      } 
    ]
  },
  {
    path: '/:pathMatch(.*)*',    // 此处需特别注意至于最底部
    component: () => import('@/views/404.vue'),
  }
]
const router = createRouter({
  history: createWebHistory(),
  routes,
})

export default router
